<template>
  <vue-office-pdf :src="fileSrc" style="height: 100%" @rendered="renderedHandler" @error="errorHandler" />
</template>

<script>
//引入VueOfficeDocx组件
import VueOfficePdf from "@vue-office/pdf";
//引入相关样式
// import "@vue-office/pdf/lib/index.css";

export default {
  components: {
    VueOfficePdf,
  },
  props: {
    fileSrc: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    renderedHandler() {
      //console.log("渲染完成");
    },
    errorHandler(e) {
      //console.log("渲染失败", e);
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .docx-wrapper {
  background: #fff;
  padding-top: 12px;
}
::v-deep .docx-wrapper > section.docx {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
::v-deep .docx-wrapper {
  svg {
    z-index: 100 !important;
  }
}
</style>
